package com.ph.util.report;

import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;

import com.ph.irp.dto.FunctionDTO;

public class GenerateFunctionTypePurview implements GenerateReport {
	public void createSheetHead(HSSFSheet sheet) {
		HSSFRow row = sheet.createRow(0);// 创建第一行

		HSSFCell cell = row.createCell(0); // 创建第一列
		cell.setCellValue(new HSSFRichTextString("权限类型"));

		cell = row.createCell(1);// 创建第二列
		cell.setCellValue(new HSSFRichTextString("权限名称"));

		cell = row.createCell(2);// 创建第三列
		cell.setCellValue(new HSSFRichTextString("详细描述"));

		cell = row.createCell(3);// 创建第四列
		cell.setCellValue(new HSSFRichTextString("用户组合"));

	

	}

	public void createSheetContent(HSSFSheet sheet, List<FunctionDTO> list) {
		HSSFRow row;
		HSSFCell cell;
		for (int i = 0; i < list.size(); i++) {
			FunctionDTO fDTO = (FunctionDTO) list.get(i);

			row = sheet.createRow(i + 1);// 创建第i+1行

			cell = row.createCell(0);// 创建第1列
			cell.setCellValue(new HSSFRichTextString(fDTO.getFunctionTypeName()));

			cell = row.createCell(1);// 创建第2列
			cell.setCellValue(new HSSFRichTextString(fDTO.getFunctionName()));

			cell = row.createCell(2);// 创建第3列
			cell.setCellValue(new HSSFRichTextString(fDTO.getFunctionDesc()));

			cell = row.createCell(3);// 创建第4列
			cell.setCellValue(new HSSFRichTextString(fDTO.getUserGroupName()));
		}
	
	

	}

}
